package com.feiyangedu.sample;

public class Main {
    public static void main(String[] args)  throws  Exception{
        Thread t1 = new HelloThread("Bod");
        System.out.println("Main Start");
        t1.start();

        t1.join();
        System.out.println("Main end");
    }
}

class HelloThread extends Thread {

    String name;

    public HelloThread(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        System.out.println("Hello, " + name + "!");
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
